package com.gopay.common.domain.entrust;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * 鉴权信息类
 *
 * Created by PanShiChao on 2016/12/23.
 */
@Entity
@Table(name = "CARD_AUTHENTICATION_INFO")
public class CardAuthenticationInfo extends BaseEntity {

    private static final long serialVersionUID = 1L;
    //INFO_ID（表主键）
    private String infoId;
    //GOPAY_ORDER_ID（国付宝订单号）
    private String gopayOrderId;
    //ACC_TYPE（银行卡类型）
    private String accTypeValue;
    //MER_ORDER_NO(商户订单号)
    private String merOrderNo;
    //MER_ID
    private String merId;
    //BUYER_REAL_MOBILE(开户人手机号)
    private String buyerRealMobile;
    //BUYER_REAL_BANK_ACCTNUM(开户行卡号)
    private String buyerRealBankAcctNum;
    //BUYER_REAL_CERTNO(开户人身份证号)
    private String buyerRealCertNo;
    //BUYER_REAL_NAME(开户人姓名)
    private String buyerRealName;
    //CARD_AUTH_NO(鉴权协议号)
    private String cardAuthNo;
    //TRANS_TS(交易时间)
    private Date transTs;
    //AUTHED_STATUS(鉴权结果)
    private String authedStatus;
    //CREATED_TS（鉴权信息创建时间）
    private Date createTs;
    //LAST_UPD_TS（鉴权信息修改时间）
    private Date lastUpdTs;
    //version(乐观锁版本)
    private Integer version;
    
	/**
	 * 短信发送次数
	 */
	
	private Integer smsSendCount;
	
	@Basic
	@Column(name="SMS_SEND_COUNT")
	public Integer getSmsSendCount() {
		return smsSendCount;
	}

	public void setSmsSendCount(Integer smsSendCount) {
		this.smsSendCount = smsSendCount;
	}

	@Basic
	@Column(name="LAST_SEND_TIME")
	public Date getLastSendTime() {
		return lastSendTime;
	}

	public void setLastSendTime(Date lastSendTime) {
		this.lastSendTime = lastSendTime;
	}

	/**
	 * 短信发送时间
	 */

	private Date lastSendTime;

    public CardAuthenticationInfo() {
    }

    @Id
    @GenericGenerator(name="systemUUID",strategy="uuid")
    @GeneratedValue(generator="systemUUID")
    @Column(name = "INFO_ID", insertable = true, updatable = true, nullable = false)
    public String getInfoId() {
        return infoId;
    }

    public void setInfoId(String infoId) {
        this.infoId = infoId;
    }

    @Basic
    @Column(name = "GOPAY_ORDER_ID")
    public String getGopayOrderId() {
        return gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }
    @Basic
    @Column(name = "ACC_TYPE")
    public String getAccTypeValue() {
        return accTypeValue;
    }

    public void setAccTypeValue(String accTypeValue) {
        this.accTypeValue = accTypeValue;
    }
    @Basic
    @Column(name = "MER_ORDER_NO")
    public String getMerOrderNo() {
        return merOrderNo;
    }

    public void setMerOrderNo(String merOrderNo) {
        this.merOrderNo = merOrderNo;
    }
    @Basic
    @Column(name = "BUYER_REAL_MOBILE")
    public String getBuyerRealMobile() {
        return SensitiveInfoUtils.smartDecryptWithCheck(buyerRealMobile);
    }

    public void setBuyerRealMobile(String buyerRealMobile) {
        this.buyerRealMobile = SensitiveInfoUtils.smartEncryptWithCheck(buyerRealMobile);
    }
    @Basic
    @Column(name = "BUYER_REAL_BANK_ACCTNUM")
    public String getBuyerRealBankAcctNum() {
        return SensitiveInfoUtils.smartDecryptWithCheck(buyerRealBankAcctNum);
    }

    public void setBuyerRealBankAcctNum(String buyerRealBankAcctNum) {
        this.buyerRealBankAcctNum = SensitiveInfoUtils.smartEncryptWithCheck(buyerRealBankAcctNum);
    }
    @Basic
    @Column(name = "BUYER_REAL_CERTNO")
    public String getBuyerRealCertNo() {
        return SensitiveInfoUtils.smartDecryptWithCheck(buyerRealCertNo);
    }

    public void setBuyerRealCertNo(String buyerRealCertNo) {
        this.buyerRealCertNo = SensitiveInfoUtils.smartEncryptWithCheck(buyerRealCertNo);
    }

    @Basic
    @Column(name = "BUYER_REAL_NAME")
    public String getBuyerRealName() {
        return SensitiveInfoUtils.smartDecryptWithCheck(buyerRealName);
    }

    public void setBuyerRealName(String buyerRealName) {
        this.buyerRealName = SensitiveInfoUtils.smartEncryptWithCheck(buyerRealName);
    }
    @Basic
    @Column(name = "CARD_AUTH_NO")
    public String getCardAuthNo() {
        return cardAuthNo;
    }

    public void setCardAuthNo(String cardAuthNo) {
        this.cardAuthNo = cardAuthNo;
    }
    @Basic
    @Column(name = "TRANS_TS")
    public Date getTransTs() {
        return transTs;
    }

    public void setTransTs(Date transTs) {
        this.transTs = transTs;
    }
    @Basic
    @Column(name = "AUTHED_STATUS")
    public String getAuthedStatus() {
        return authedStatus;
    }

    public void setAuthedStatus(String authedStatus) {
        this.authedStatus = authedStatus;
    }
    @Basic
    @Column(name = "CREATED_TS")
    public Date getCreateTs() {
        return createTs;
    }

    public void setCreateTs(Date createTs) {
        this.createTs = createTs;
    }
    @Basic
    @Column(name = "LAST_UPD_TS")
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }
    @Basic
    @Column(name = "version")
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
    @Basic
    @Column(name = "MER_ID")
    public String getMerId() {
        return merId;
    }

    public void setMerId(String merId) {
        this.merId = merId;
    }
}
